import type { Express } from 'express';
import express from 'express';
import cors from 'cors';

const useApi = (app: Express) => {
  app.use(cors());
  // app.use('/aa', express.static('public'));
  app.use(express.static('public'));
  app.use(express.json());

  app.get('/test', (req, res) => {
    res.send({
      code: 200,
      msg: '请求成功',
      data: {
        aa: '123'
      }
    });
  });
};

export default useApi;
